<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends Action {
    public function index() {
//        header("Content-Type:text/html; charset=utf-8");
//        if(!Session::is_set(C('USER_AUTH_KEY')))
//        //if(!isset($_SESSION['USER_AUTH_KEY'])||($_SESSION['USER_AUTH_KEY']==0))//不能用此句
//        {
//            $msg="用户没有登录";
//            redirect("index.php/Index/login");
//        }
//        else {
//            $msg=Session::get(C('USER_AUTH_KEY')).'欢迎你回来';
//        }
        $this->assign('msg',$msg);
        $this->display();
    }
        public function index1() { 
        $this->display();
    }
    public function testdiv(){
        $this->display();
    }
    public function divc(){
        $this->display();
    }
    public function ts(){
        $this->display();
    }
     public function tt(){
        $this->display();
    }
    public function login() {
        $this->assign('title','flyer');
        $this->display();
    }
    public function test() {
        $this->display();
    }
    public function checklogin() { 
        $Form=D('User');
        $vo=$Form->create();
        if ($vo) {
            $list=$Form->where(array('account'=>$vo['account'],'password'=>md5( $vo['password'])))->findAll();
            if (!empty ($list)) {
                $this->ajaxReturn($vo,'表单数据保存成功！',1);
            }else {
              //  $this->error("失败");
            }
        }
    }
    
    public function insert() {
        $Form    =    D("Form");
        //验证码验证
        if($vo = $Form->create()) {
            if($Form->add()) {
                $vo['create_time']     =     date('Y-m-d H:i:s',$vo['create_time']);
                $vo['content']    =    nl2br($vo['content']);
                $this->ajaxReturn($vo,'表单数据保存成功！',1);
            }else {
                $this->error('数据写入错误！');
            }
        }else {
            $this->error($Form->getError());
        }
    }


}

?>